<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* var str='hello world!'
        var reg=/o/g
        var result=str.match(reg)
        console.log(result) */

        /* var str='hello wOrld!'
        var reg=/o/gi
        var s=str.replace(reg,'@')
        console.log(s); */

        /* var str1='Java love me'
        var str2='i love java'
        var reg=/^java/i
        var reg1=/java$/i
        console.log(reg.test(str1));
        console.log(reg1.test(str2)); */


        var str='Ga12312'
        var reg=/^[a-zA-Z][a-zA-Z0-9_]{5,9}$/
        console.log(reg.test(str));
        
        


        




        
        
    </script>
</body>
</html>